Getting Started

This tutorial will install MoveIt2 and create a workspace sandbox to run the tutorials and example robot.

Install ROS2 and Colcon

Install ROS2 Foxy. It is easy to miss steps when going through the ROS2 installation tutorial. If you run into errors in the next few steps, a good place to start is to go back and make sure you have installed ROS2 correctly.

Install rosdep2 to install system dependencies :

sudo apt install python3-rosdep2

Once you have ROS2 installed, make sure you have the most up to date packages:

rosdep update
sudo apt update
sudo apt dist-upgrade

Install Colcon the ROS2 build system:

sudo apt install python3-colcon-common-extensions

Install vcstool :

sudo apt install python3-vcstool

Create A Colcon Workspace and Download MoveIt2 Source

These tutorials rely on the master branch of MoveIt2, which requires a build from source. You will need to have a colcon workspace setup:

mkdir -p ~/ws_moveit2/src
cd ~/ws_moveit2/src

git clone
git clone
vcs import < moveit2/moveit2.repos
vcs import < moveit2_tutorials/moveit2_tutorials.repos

Build your Colcon Workspace

The following will install from Debian any package dependencies not already in your workspace:

rosdep install -r --from-paths . --ignore-src --rosdistro foxy -y

The next command will configure your colcon workspace:

cd ~/ws_moveit2
colcon build --event-handlers desktop_notification- status- --cmake-args -DCMAKE_BUILD_TYPE=Release

Source the colcon workspace:

source ~/ws_moveit2/install/setup.bash

Optional: add the previous command to your .bashrc:

echo 'source ~/ws_moveit2/install/setup.bash' >> ~/.bashrc


Sourcing the setup.bash automatically in your ~/.bashrc is not required and often skipped by advanced users who use more than one colcon workspace at a time, but we recommend it for simplicity.

Open Source Feedback

See something that needs improvement? Please open a pull request on this GitHub page